import pandas as pd
import pymysql

#TODO 读取数据 csv(,) tsv(\t) txt(自定义分割符)
data=pd.read_csv('data/lj_data.csv')

# 获取前n行  #默认前5行
print(data.head())

#查看数据形状,返回行列
print(data.shape)

#查看字段名
print(data.columns)

#查看索引
print(data.index)


#TODO excel数据
data1=pd.read_excel('data/sales.xlsx')
print(data1.head())
print(data1.index)


#TODO mysql数据
conn=pymysql.connect(user='root',password='1141014',database='tdo_do',charset='utf8')
data2=pd.read_sql(sql='select * from student',con=conn)
print(data2)




